#ifndef __RC38_H
#define __RC38_H

#include "stm8s.h"

#define RC38_PIN        GPIOD, GPIO_PIN_3

typedef enum
{
  RC38_WAIT = 0,
  RC38_RX,
  RC38_DONE
}type_rc38_status;

typedef struct
{
uint16_t timer;
type_i2c data;
uint8_t pc;
type_rc38_status status;
}type_rc38;

void rc38_init(void);
uint8_t rc38_get(void);
void rc38_fun(void);
void rc38_interrupt(void);

#endif